home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / cafead1a / frmini.frm (.txt) < prev    next >
Visual Basic Form  |  1999-10-06  |  6KB  |  194 lines

  1. VERSION 4.00
  2. Begin VB.Form frmIni 
  3.    Caption         =   "Administrator Settings"
  4.    ClientHeight    =   3060
  5.    ClientLeft      =   1890
  6.    ClientTop       =   3435
  7.    ClientWidth     =   5535
  8.    Height          =   3495
  9.    Left            =   1830
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   3060
  12.    ScaleWidth      =   5535
  13.    Top             =   3060
  14.    Width           =   5655
  15.    Begin VB.CommandButton cmdGetTime 
  16.       Caption         =   "View Remaining Time"
  17.       Height          =   375
  18.       Left            =   3195
  19.       TabIndex        =   12
  20.       Top             =   285
  21.       Width           =   2190
  22.    End
  23.    Begin VB.TextBox txtTime 
  24.       Height          =   330
  25.       Left            =   1935
  26.       TabIndex        =   10
  27.       Top             =   750
  28.       Width           =   1035
  29.    End
  30.    Begin VB.CommandButton Command1 
  31.       Caption         =   "View Password List "
  32.       Height          =   360
  33.       Left            =   1215
  34.       TabIndex        =   9
  35.       Top             =   1665
  36.       Width           =   3195
  37.    End
  38.    Begin VB.CommandButton Command4 
  39.       Caption         =   "End Internet Cafe Program"
  40.       Height          =   360
  41.       Left            =   1215
  42.       TabIndex        =   8
  43.       Top             =   2625
  44.       Width           =   3195
  45.    End
  46.    Begin VB.CommandButton Command3 
  47.       Caption         =   "Close Administrator Window"
  48.       Height          =   360
  49.       Left            =   1215
  50.       TabIndex        =   6
  51.       Top             =   2130
  52.       Width           =   3210
  53.    End
  54.    Begin VB.CommandButton cmdSave2 
  55.       Caption         =   "Save New Password"
  56.       Height          =   360
  57.       Left            =   3210
  58.       TabIndex        =   5
  59.       Top             =   1155
  60.       Width           =   2220
  61.    End
  62.    Begin VB.CommandButton cmdClear 
  63.       Caption         =   "Reset Time and Password"
  64.       Height          =   375
  65.       Left            =   3195
  66.       TabIndex        =   4
  67.       Top             =   720
  68.       Width           =   2220
  69.    End
  70.    Begin VB.TextBox txtValue2 
  71.       Height          =   330
  72.       Left            =   1950
  73.       TabIndex        =   3
  74.       Top             =   1185
  75.       Width           =   1035
  76.    End
  77.    Begin VB.TextBox txtUser 
  78.       Height          =   330
  79.       Left            =   1920
  80.       TabIndex        =   2
  81.       Top             =   300
  82.       Width           =   1035
  83.    End
  84.    Begin VB.Label Label4 
  85.       Alignment       =   2  'Center
  86.       Caption         =   "Remaining Time"
  87.       Height          =   285
  88.       Left            =   45
  89.       TabIndex        =   11
  90.       Top             =   735
  91.       Width           =   1350
  92.    End
  93.    Begin VB.Label Label3 
  94.       Alignment       =   2  'Center
  95.       BackStyle       =   0  'Transparent
  96.       Caption         =   "View and Edit Passwords"
  97.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  98.          Name            =   "MS Sans Serif"
  99.          Size            =   9.75
  100.          Charset         =   0
  101.          Weight          =   700
  102.          Underline       =   0   'False
  103.          Italic          =   0   'False
  104.          Strikethrough   =   0   'False
  105.       EndProperty
  106.       Height          =   330
  107.       Left            =   840
  108.       TabIndex        =   7
  109.       Top             =   0
  110.       Width           =   3180
  111.    End
  112.    Begin VB.Label Label2 
  113.       Alignment       =   2  'Center
  114.       BackStyle       =   0  'Transparent
  115.       Caption         =   "Administrator Password"
  116.       Height          =   270
  117.       Left            =   -60
  118.       TabIndex        =   1
  119.       Top             =   1170
  120.       Width           =   1995
  121.    End
  122.    Begin VB.Label Label1 
  123.       Alignment       =   2  'Center
  124.       BackStyle       =   0  'Transparent
  125.       Caption         =   "User Password"
  126.       Height          =   345
  127.       Left            =   0
  128.       TabIndex        =   0
  129.       Top             =   345
  130.       Width           =   1395
  131.    End
  132. Attribute VB_Name = "frmIni"
  133. Attribute VB_Creatable = False
  134. Attribute VB_Exposed = False
  135. Option Explicit
  136. Private Sub cmdClear_Click() 'will create new password and set time for it
  137. Dim lngResult As Long
  138. Dim strFileName
  139. On Error GoTo Err
  140. strFileName = App.Path & "\Passwords.ini"
  141. If txtUser.Text = "" Or txtTime.Text = "" Then Exit Sub
  142. lngResult = WritePrivateProfileString("Passwords", _
  143. txtUser.Text, txtTime.Text, strFileName)
  144. Exit Sub
  145. End Sub
  146. Private Sub cmdGetTime_Click()
  147. Dim strResult As String * 60 'no variable length strings allowed
  148. Dim lngResult As Long
  149. Dim strFileName As String
  150. strFileName = App.Path & "\Passwords.ini"
  151. On Error GoTo Err
  152. If txtUser.Text = "" Then Exit Sub 'must enter password
  153. lngResult = GetPrivateProfileString("Passwords", _
  154. txtUser.Text, strFileName, strResult, Len(strResult), _
  155. strFileName)
  156. txtTime.Text = Trim(strResult)
  157. If Len(txtTime.Text) > 3 Then 'means there was no entry
  158. txtTime.Text = "" 'and a path was returned-default
  159. End If
  160. Exit Sub
  161. Err: txtTime.Text = "" 'clear time field
  162. End Sub
  163. Private Sub cmdSave2_Click() 'save new admin password
  164. Dim lngResult2 As Long
  165. Dim strFileName
  166. strFileName = App.Path & "\Passwords.ini"
  167. lngResult2 = WritePrivateProfileString("Passwords", _
  168. "Administrator", txtValue2.Text, strFileName)
  169. End Sub
  170. Private Sub Command1_Click() 'show password list
  171. Run Me, App.Path & "\Passwords.ini"
  172. End Sub
  173. Private Sub Command3_Click() 'close admin window
  174. frmIni.Hide
  175. Cafe.Label4.Visible = False
  176. Cafe.Label5.Visible = False
  177. Cafe.cmdLogOn.Visible = False
  178. Cafe.txtPass.Text = ""
  179. End Sub
  180. Private Sub Command4_Click() 'end program
  181. TaskBar True 'show taskbar
  182. DisableKeys False 'make keys work again
  183. End Sub
  184. Private Sub Form_Load() 'show admin password
  185. Dim strFileName As String
  186. Dim lngResult2 As Long
  187. Dim strResult2 As String * 60
  188. strFileName = App.Path & "\Passwords.ini"
  189. lngResult2 = GetPrivateProfileString("Passwords", _
  190. "Administrator", strFileName, strResult2, Len(strResult2), _
  191. strFileName)
  192. txtValue2.Text = Trim(strResult2)
  193. End Sub
  194.